Optimal. Leaf size=365 \[ \frac {B (b c-a d) h \left (a^3 d^3 h^3-a^2 b d^2 h^2 (5 d g-c h)+a b^2 d h \left (10 d^2 g^2-5 c d g h+c^2 h^2\right )-b^3 \left (10 d^3 g^3-10 c d^2 g^2 h+5 c^2 d g h^2-c^3 h^3\right )\right ) n x}{5 b^4 d^4}-\frac {B (b c-a d) h^2 \left (a^2 d^2 h^2-a b d h (5 d g-c h)+b^2 \left (10 d^2 g^2-5 c d g h+c^2 h^2\right )\right ) n x^2}{10 b^3 d^3}-\frac {B (b c-a d) h^3 (5 b d g-b c h-a d h) n x^3}{15 b^2 d^2}-\frac {B (b c-a d) h^4 n x^4}{20 b d}-\frac {B (b g-a h)^5 n \log (a+b x)}{5 b^5 h}+\frac {B (d g-c h)^5 n \log (c+d x)}{5 d^5 h}+\frac {(g+h x)^5 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )}{5 h} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.36, antiderivative size = 365, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.065, Rules used = {2548, 84}
\begin {gather*} -\frac {B h^2 n x^2 (b c-a d) \left (a^2 d^2 h^2-a b d h (5 d g-c h)+b^2 \left (c^2 h^2-5 c d g h+10 d^2 g^2\right )\right )}{10 b^3 d^3}+\frac {B h n x (b c-a d) \left (a^3 d^3 h^3-a^2 b d^2 h^2 (5 d g-c h)+a b^2 d h \left (c^2 h^2-5 c d g h+10 d^2 g^2\right )-\left (b^3 \left (-c^3 h^3+5 c^2 d g h^2-10 c d^2 g^2 h+10 d^3 g^3\right )\right )\right )}{5 b^4 d^4}+\frac {(g+h x)^5 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{5 h}-\frac {B n (b g-a h)^5 \log (a+b x)}{5 b^5 h}-\frac {B h^3 n x^3 (b c-a d) (-a d h-b c h+5 b d g)}{15 b^2 d^2}-\frac {B h^4 n x^4 (b c-a d)}{20 b d}+\frac {B n (d g-c h)^5 \log (c+d x)}{5 d^5 h} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 84
Rule 2548
Rubi steps
\begin {align*} \int (g+h x)^4 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx &=\int \left (A (g+h x)^4+B (g+h x)^4 \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx\\ &=\frac {A (g+h x)^5}{5 h}+B \int (g+h x)^4 \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \, dx\\ &=\frac {A (g+h x)^5}{5 h}+\frac {B (g+h x)^5 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{5 h}-\frac {(B (b c-a d) n) \int \frac {(g+h x)^5}{(a+b x) (c+d x)} \, dx}{5 h}\\ &=\frac {A (g+h x)^5}{5 h}+\frac {B (g+h x)^5 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{5 h}-\frac {(B (b c-a d) n) \int \left (\frac {h^2 \left (-a^3 d^3 h^3+a^2 b d^2 h^2 (5 d g-c h)-a b^2 d h \left (10 d^2 g^2-5 c d g h+c^2 h^2\right )+b^3 \left (10 d^3 g^3-10 c d^2 g^2 h+5 c^2 d g h^2-c^3 h^3\right )\right )}{b^4 d^4}+\frac {h^3 \left (a^2 d^2 h^2-a b d h (5 d g-c h)+b^2 \left (10 d^2 g^2-5 c d g h+c^2 h^2\right )\right ) x}{b^3 d^3}+\frac {h^4 (5 b d g-b c h-a d h) x^2}{b^2 d^2}+\frac {h^5 x^3}{b d}+\frac {(b g-a h)^5}{b^4 (b c-a d) (a+b x)}+\frac {(d g-c h)^5}{d^4 (-b c+a d) (c+d x)}\right ) \, dx}{5 h}\\ &=\frac {B (b c-a d) h \left (a^3 d^3 h^3-a^2 b d^2 h^2 (5 d g-c h)+a b^2 d h \left (10 d^2 g^2-5 c d g h+c^2 h^2\right )-b^3 \left (10 d^3 g^3-10 c d^2 g^2 h+5 c^2 d g h^2-c^3 h^3\right )\right ) n x}{5 b^4 d^4}-\frac {B (b c-a d) h^2 \left (a^2 d^2 h^2-a b d h (5 d g-c h)+b^2 \left (10 d^2 g^2-5 c d g h+c^2 h^2\right )\right ) n x^2}{10 b^3 d^3}-\frac {B (b c-a d) h^3 (5 b d g-b c h-a d h) n x^3}{15 b^2 d^2}-\frac {B (b c-a d) h^4 n x^4}{20 b d}+\frac {A (g+h x)^5}{5 h}-\frac {B (b g-a h)^5 n \log (a+b x)}{5 b^5 h}+\frac {B (d g-c h)^5 n \log (c+d x)}{5 d^5 h}+\frac {B (g+h x)^5 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{5 h}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.33, size = 452, normalized size = 1.24 \begin {gather*} \frac {12 a B d^5 \left (5 b^4 g^4-10 a b^3 g^3 h+10 a^2 b^2 g^2 h^2-5 a^3 b g h^3+a^4 h^4\right ) n \log (a+b x)-12 b^5 B c \left (5 d^4 g^4-10 c d^3 g^3 h+10 c^2 d^2 g^2 h^2-5 c^3 d g h^3+c^4 h^4\right ) n \log (c+d x)+b d x \left (12 A b^4 d^4 \left (5 g^4+10 g^3 h x+10 g^2 h^2 x^2+5 g h^3 x^3+h^4 x^4\right )+B (b c-a d) h n \left (12 a^3 d^3 h^3-6 a^2 b d^2 h^2 (10 d g-2 c h+d h x)+2 a b^2 d h \left (6 c^2 h^2-3 c d h (10 g+h x)+d^2 \left (60 g^2+15 g h x+2 h^2 x^2\right )\right )-b^3 \left (-12 c^3 h^3+6 c^2 d h^2 (10 g+h x)-2 c d^2 h \left (60 g^2+15 g h x+2 h^2 x^2\right )+d^3 \left (120 g^3+60 g^2 h x+20 g h^2 x^2+3 h^3 x^3\right )\right )\right )+12 b^4 B d^4 \left (5 g^4+10 g^3 h x+10 g^2 h^2 x^2+5 g h^3 x^3+h^4 x^4\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )}{60 b^5 d^5} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
3.
time = 0.64, size = 2612, normalized size = 7.16
method | result | size |
risch | \(\text {Expression too large to display}\) | \(2612\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.31, size = 681, normalized size = 1.87 \begin {gather*} \frac {1}{5} \, B h^{4} x^{5} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + \frac {1}{5} \, A h^{4} x^{5} + B g h^{3} x^{4} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A g h^{3} x^{4} + 2 \, B g^{2} h^{2} x^{3} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + 2 \, A g^{2} h^{2} x^{3} + 2 \, B g^{3} h x^{2} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + 2 \, A g^{3} h x^{2} + {\left (\frac {a n e \log \left (b x + a\right )}{b} - \frac {c n e \log \left (d x + c\right )}{d}\right )} B g^{4} e^{\left (-1\right )} - 2 \, {\left (\frac {a^{2} n e \log \left (b x + a\right )}{b^{2}} - \frac {c^{2} n e \log \left (d x + c\right )}{d^{2}} + \frac {{\left (b c n - a d n\right )} x e}{b d}\right )} B g^{3} h e^{\left (-1\right )} + {\left (\frac {2 \, a^{3} n e \log \left (b x + a\right )}{b^{3}} - \frac {2 \, c^{3} n e \log \left (d x + c\right )}{d^{3}} - \frac {{\left (b^{2} c d n - a b d^{2} n\right )} x^{2} e - 2 \, {\left (b^{2} c^{2} n - a^{2} d^{2} n\right )} x e}{b^{2} d^{2}}\right )} B g^{2} h^{2} e^{\left (-1\right )} - \frac {1}{6} \, {\left (\frac {6 \, a^{4} n e \log \left (b x + a\right )}{b^{4}} - \frac {6 \, c^{4} n e \log \left (d x + c\right )}{d^{4}} + \frac {2 \, {\left (b^{3} c d^{2} n - a b^{2} d^{3} n\right )} x^{3} e - 3 \, {\left (b^{3} c^{2} d n - a^{2} b d^{3} n\right )} x^{2} e + 6 \, {\left (b^{3} c^{3} n - a^{3} d^{3} n\right )} x e}{b^{3} d^{3}}\right )} B g h^{3} e^{\left (-1\right )} + \frac {1}{60} \, {\left (\frac {12 \, a^{5} n e \log \left (b x + a\right )}{b^{5}} - \frac {12 \, c^{5} n e \log \left (d x + c\right )}{d^{5}} - \frac {3 \, {\left (b^{4} c d^{3} n - a b^{3} d^{4} n\right )} x^{4} e - 4 \, {\left (b^{4} c^{2} d^{2} n - a^{2} b^{2} d^{4} n\right )} x^{3} e + 6 \, {\left (b^{4} c^{3} d n - a^{3} b d^{4} n\right )} x^{2} e - 12 \, {\left (b^{4} c^{4} n - a^{4} d^{4} n\right )} x e}{b^{4} d^{4}}\right )} B h^{4} e^{\left (-1\right )} + B g^{4} x \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A g^{4} x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 733 vs.
\(2 (352) = 704\).
time = 0.37, size = 733, normalized size = 2.01 \begin {gather*} \frac {12 \, {\left (A + B\right )} b^{5} d^{5} h^{4} x^{5} + 3 \, {\left (20 \, {\left (A + B\right )} b^{5} d^{5} g h^{3} - {\left (B b^{5} c d^{4} - B a b^{4} d^{5}\right )} h^{4} n\right )} x^{4} + 4 \, {\left (30 \, {\left (A + B\right )} b^{5} d^{5} g^{2} h^{2} - {\left (5 \, {\left (B b^{5} c d^{4} - B a b^{4} d^{5}\right )} g h^{3} - {\left (B b^{5} c^{2} d^{3} - B a^{2} b^{3} d^{5}\right )} h^{4}\right )} n\right )} x^{3} + 6 \, {\left (20 \, {\left (A + B\right )} b^{5} d^{5} g^{3} h - {\left (10 \, {\left (B b^{5} c d^{4} - B a b^{4} d^{5}\right )} g^{2} h^{2} - 5 \, {\left (B b^{5} c^{2} d^{3} - B a^{2} b^{3} d^{5}\right )} g h^{3} + {\left (B b^{5} c^{3} d^{2} - B a^{3} b^{2} d^{5}\right )} h^{4}\right )} n\right )} x^{2} + 12 \, {\left (5 \, {\left (A + B\right )} b^{5} d^{5} g^{4} - {\left (10 \, {\left (B b^{5} c d^{4} - B a b^{4} d^{5}\right )} g^{3} h - 10 \, {\left (B b^{5} c^{2} d^{3} - B a^{2} b^{3} d^{5}\right )} g^{2} h^{2} + 5 \, {\left (B b^{5} c^{3} d^{2} - B a^{3} b^{2} d^{5}\right )} g h^{3} - {\left (B b^{5} c^{4} d - B a^{4} b d^{5}\right )} h^{4}\right )} n\right )} x + 12 \, {\left (B b^{5} d^{5} h^{4} n x^{5} + 5 \, B b^{5} d^{5} g h^{3} n x^{4} + 10 \, B b^{5} d^{5} g^{2} h^{2} n x^{3} + 10 \, B b^{5} d^{5} g^{3} h n x^{2} + 5 \, B b^{5} d^{5} g^{4} n x + {\left (5 \, B a b^{4} d^{5} g^{4} - 10 \, B a^{2} b^{3} d^{5} g^{3} h + 10 \, B a^{3} b^{2} d^{5} g^{2} h^{2} - 5 \, B a^{4} b d^{5} g h^{3} + B a^{5} d^{5} h^{4}\right )} n\right )} \log \left (b x + a\right ) - 12 \, {\left (B b^{5} d^{5} h^{4} n x^{5} + 5 \, B b^{5} d^{5} g h^{3} n x^{4} + 10 \, B b^{5} d^{5} g^{2} h^{2} n x^{3} + 10 \, B b^{5} d^{5} g^{3} h n x^{2} + 5 \, B b^{5} d^{5} g^{4} n x + {\left (5 \, B b^{5} c d^{4} g^{4} - 10 \, B b^{5} c^{2} d^{3} g^{3} h + 10 \, B b^{5} c^{3} d^{2} g^{2} h^{2} - 5 \, B b^{5} c^{4} d g h^{3} + B b^{5} c^{5} h^{4}\right )} n\right )} \log \left (d x + c\right )}{60 \, b^{5} d^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: HeuristicGCDFailed} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.13, size = 1434, normalized size = 3.93 \begin {gather*} x\,\left (\frac {5\,A\,b\,d\,g^4+20\,A\,a\,d\,g^3\,h+20\,A\,b\,c\,g^3\,h+30\,A\,a\,c\,g^2\,h^2+10\,B\,a\,d\,g^3\,h\,n-10\,B\,b\,c\,g^3\,h\,n}{5\,b\,d}-\frac {\left (5\,a\,d+5\,b\,c\right )\,\left (\frac {20\,A\,a\,c\,g\,h^3+20\,A\,b\,d\,g^3\,h+30\,A\,a\,d\,g^2\,h^2+30\,A\,b\,c\,g^2\,h^2+10\,B\,a\,d\,g^2\,h^2\,n-10\,B\,b\,c\,g^2\,h^2\,n}{5\,b\,d}+\frac {\left (5\,a\,d+5\,b\,c\right )\,\left (\frac {\left (\frac {5\,A\,a\,d\,h^4+5\,A\,b\,c\,h^4+20\,A\,b\,d\,g\,h^3+B\,a\,d\,h^4\,n-B\,b\,c\,h^4\,n}{5\,b\,d}-\frac {A\,h^4\,\left (5\,a\,d+5\,b\,c\right )}{5\,b\,d}\right )\,\left (5\,a\,d+5\,b\,c\right )}{5\,b\,d}-\frac {5\,A\,a\,c\,h^4+20\,A\,a\,d\,g\,h^3+20\,A\,b\,c\,g\,h^3+30\,A\,b\,d\,g^2\,h^2+5\,B\,a\,d\,g\,h^3\,n-5\,B\,b\,c\,g\,h^3\,n}{5\,b\,d}+\frac {A\,a\,c\,h^4}{b\,d}\right )}{5\,b\,d}-\frac {a\,c\,\left (\frac {5\,A\,a\,d\,h^4+5\,A\,b\,c\,h^4+20\,A\,b\,d\,g\,h^3+B\,a\,d\,h^4\,n-B\,b\,c\,h^4\,n}{5\,b\,d}-\frac {A\,h^4\,\left (5\,a\,d+5\,b\,c\right )}{5\,b\,d}\right )}{b\,d}\right )}{5\,b\,d}+\frac {a\,c\,\left (\frac {\left (\frac {5\,A\,a\,d\,h^4+5\,A\,b\,c\,h^4+20\,A\,b\,d\,g\,h^3+B\,a\,d\,h^4\,n-B\,b\,c\,h^4\,n}{5\,b\,d}-\frac {A\,h^4\,\left (5\,a\,d+5\,b\,c\right )}{5\,b\,d}\right )\,\left (5\,a\,d+5\,b\,c\right )}{5\,b\,d}-\frac {5\,A\,a\,c\,h^4+20\,A\,a\,d\,g\,h^3+20\,A\,b\,c\,g\,h^3+30\,A\,b\,d\,g^2\,h^2+5\,B\,a\,d\,g\,h^3\,n-5\,B\,b\,c\,g\,h^3\,n}{5\,b\,d}+\frac {A\,a\,c\,h^4}{b\,d}\right )}{b\,d}\right )+\ln \left (\frac {e\,{\left (a+b\,x\right )}^n}{{\left (c+d\,x\right )}^n}\right )\,\left (B\,g^4\,x+2\,B\,g^3\,h\,x^2+2\,B\,g^2\,h^2\,x^3+B\,g\,h^3\,x^4+\frac {B\,h^4\,x^5}{5}\right )+x^4\,\left (\frac {5\,A\,a\,d\,h^4+5\,A\,b\,c\,h^4+20\,A\,b\,d\,g\,h^3+B\,a\,d\,h^4\,n-B\,b\,c\,h^4\,n}{20\,b\,d}-\frac {A\,h^4\,\left (5\,a\,d+5\,b\,c\right )}{20\,b\,d}\right )-x^3\,\left (\frac {\left (\frac {5\,A\,a\,d\,h^4+5\,A\,b\,c\,h^4+20\,A\,b\,d\,g\,h^3+B\,a\,d\,h^4\,n-B\,b\,c\,h^4\,n}{5\,b\,d}-\frac {A\,h^4\,\left (5\,a\,d+5\,b\,c\right )}{5\,b\,d}\right )\,\left (5\,a\,d+5\,b\,c\right )}{15\,b\,d}-\frac {5\,A\,a\,c\,h^4+20\,A\,a\,d\,g\,h^3+20\,A\,b\,c\,g\,h^3+30\,A\,b\,d\,g^2\,h^2+5\,B\,a\,d\,g\,h^3\,n-5\,B\,b\,c\,g\,h^3\,n}{15\,b\,d}+\frac {A\,a\,c\,h^4}{3\,b\,d}\right )+x^2\,\left (\frac {20\,A\,a\,c\,g\,h^3+20\,A\,b\,d\,g^3\,h+30\,A\,a\,d\,g^2\,h^2+30\,A\,b\,c\,g^2\,h^2+10\,B\,a\,d\,g^2\,h^2\,n-10\,B\,b\,c\,g^2\,h^2\,n}{10\,b\,d}+\frac {\left (5\,a\,d+5\,b\,c\right )\,\left (\frac {\left (\frac {5\,A\,a\,d\,h^4+5\,A\,b\,c\,h^4+20\,A\,b\,d\,g\,h^3+B\,a\,d\,h^4\,n-B\,b\,c\,h^4\,n}{5\,b\,d}-\frac {A\,h^4\,\left (5\,a\,d+5\,b\,c\right )}{5\,b\,d}\right )\,\left (5\,a\,d+5\,b\,c\right )}{5\,b\,d}-\frac {5\,A\,a\,c\,h^4+20\,A\,a\,d\,g\,h^3+20\,A\,b\,c\,g\,h^3+30\,A\,b\,d\,g^2\,h^2+5\,B\,a\,d\,g\,h^3\,n-5\,B\,b\,c\,g\,h^3\,n}{5\,b\,d}+\frac {A\,a\,c\,h^4}{b\,d}\right )}{10\,b\,d}-\frac {a\,c\,\left (\frac {5\,A\,a\,d\,h^4+5\,A\,b\,c\,h^4+20\,A\,b\,d\,g\,h^3+B\,a\,d\,h^4\,n-B\,b\,c\,h^4\,n}{5\,b\,d}-\frac {A\,h^4\,\left (5\,a\,d+5\,b\,c\right )}{5\,b\,d}\right )}{2\,b\,d}\right )+\frac {A\,h^4\,x^5}{5}+\frac {\ln \left (a+b\,x\right )\,\left (\frac {B\,n\,a^5\,h^4}{5}-B\,n\,a^4\,b\,g\,h^3+2\,B\,n\,a^3\,b^2\,g^2\,h^2-2\,B\,n\,a^2\,b^3\,g^3\,h+B\,n\,a\,b^4\,g^4\right )}{b^5}-\frac {\ln \left (c+d\,x\right )\,\left (B\,n\,c^5\,h^4-5\,B\,n\,c^4\,d\,g\,h^3+10\,B\,n\,c^3\,d^2\,g^2\,h^2-10\,B\,n\,c^2\,d^3\,g^3\,h+5\,B\,n\,c\,d^4\,g^4\right )}{5\,d^5} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________